package com.ruoyi.hospital.service.storeInfo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.storeInfo.PharmacyDrugMapper;
import com.ruoyi.hospital.domain.storeInfo.PharmacyDrug;
import com.ruoyi.hospital.service.storeInfo.IPharmacyDrugService;

/**
 * 药品信息Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-19
 */
@Service
public class PharmacyDrugServiceImpl implements IPharmacyDrugService 
{
    @Autowired
    private PharmacyDrugMapper pharmacyDrugMapper;

    /**
     * 查询药品信息
     *
     * @param id 药品信息主键
     * @return 药品信息
     */
    @Override
    public PharmacyDrug selectPharmacyDrugById(Integer id)
    {
        return pharmacyDrugMapper.selectPharmacyDrugById(id);
    }

    /**
     * 查询药品信息列表
     *
     * @param pharmacyDrug 药品信息
     * @return 药品信息
     */
    @Override
    public List<PharmacyDrug> selectPharmacyDrugList(PharmacyDrug pharmacyDrug)
    {
        return pharmacyDrugMapper.selectPharmacyDrugList(pharmacyDrug);
    }

    /**
     * 新增药品信息
     *
     * @param pharmacyDrug 药品信息
     * @return 结果
     */
    @Override
    public int insertPharmacyDrug(PharmacyDrug pharmacyDrug)
    {
        return pharmacyDrugMapper.insertPharmacyDrug(pharmacyDrug);
    }

    /**
     * 修改药品信息
     *
     * @param pharmacyDrug 药品信息
     * @return 结果
     */
    @Override
    public int updatePharmacyDrug(PharmacyDrug pharmacyDrug)
    {
        return pharmacyDrugMapper.updatePharmacyDrug(pharmacyDrug);
    }

    /**
     * 批量删除药品信息
     *
     * @param ids 需要删除的药品信息主键
     * @return 结果
     */
    @Override
    public int deletePharmacyDrugByIds(Integer[] ids)
    {
        return pharmacyDrugMapper.deletePharmacyDrugByIds(ids);
    }

    /**
     * 删除药品信息信息
     *
     * @param id 药品信息主键
     * @return 结果
     */
    @Override
    public int deletePharmacyDrugById(Integer id)
    {
        return pharmacyDrugMapper.deletePharmacyDrugById(id);
    }

    @Override
    public PharmacyDrug getByPhaId(Integer phaId) {
        return pharmacyDrugMapper.getByPhaId(phaId);
    }
}